<?php
abstract class CV_Validate_Abstract implements Zend_Validate_Interface{
	protected $_messages = array();
	protected $_potential_messages = array();
	protected $_options = array();
	public function __construct( $options = array() ){
		$this->_options = $options;
	}
	/**
	 * @return bool
	 */
	protected abstract function _isValid( $value );
	public final function isValid( $value ){
		$this->_messages = $this->_potential_messages;
		return $this->_isValid( $value );
	}
	public function setMessages( $messages ){
		$this->_potential_messages = $messages;
	}
	public function setMessage( $message ){
		$this->_potential_messages = array( $message );
	}
	public function getMessages(){
		return $this->_messages;
	}
	public function getErrors(){
		return array_keys( $this->getMessages() );
	}
}